group { name: "e/comp/preview";
   parts {
      part { name: "e.swallow.preview"; type: SWALLOW; mouse_events: 0;
         description { state: "default" 0.0;
         }
      }
      part { name: "e.text.label"; type: TEXT; mouse_events: 0;
         scale: 1;
         description { state: "default" 0.0;
            color_class: "/fg/normal/comp/preview/text";
            text { font: FNBD; size: 10;
               text_class: "fileman_icon";
               align: 0.5 0.5;
               min: 1 1;
               ellipsis: -1;
            }
            fixed: 0 1;
         }
      }
   }
}

group { name: "e/comp/screen/base/default";
   alias: "e/comp/screen/base/noeffects"; // legacy
   parts {
      part { name: "clip"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
         }
      }
      part { name: "e.swallow.background"; type: SWALLOW;
         clip_to: "clip";
         description { state: "default" 0.0;
         }
      }
   }
}

group { name: "e/comp/screen/overlay/default";
   alias: "e/comp/screen/overlay/noeffects"; // legacy
   images.image: "screen_circular_shadow.png" COMP;
   data.item: "restarted" "on";
   parts {
      part { name: "clip"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
         }
      }
      part { name: "shadow"; mouse_events: 0;
         clip_to: "clip";
         description { state: "default" 0.0;
            rel1.relative: -1.0 -1.0;
            rel2.relative: 2.0 2.0;
            image.normal: "screen_circular_shadow.png";
            fill.smooth: 0;
            color: 255 255 255 0; // no cc
            visible: 0;
         }
         description { state: "visible" 0.0;
            inherit;
            rel1.relative: 0.0 0.0;
            rel2.relative: 1.0 1.0;
            color: 255 255 255 255; // no cc
            visible: 1;
         }
      }
      part { name: "blanker"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            visible: 0;
         }
         description { state: "visible" 0.0;
            inherit;
            color: 0 0 0 255; // no cc
            visible: 1;
         }
      }
      part { name: "suspender"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            visible: 0;
         }
         description { state: "visible" 0.0;
            inherit;
            color: 0 0 0 255; // no cc
            visible: 1;
         }
      }
   }
   programs {
         program { signal: "e,state,screensaver,on"; source: "e";
            action: STATE_SET "visible" 0.0;
            transition: ACCELERATE 3.0 USE_DURATION_FACTOR 1 CURRENT;
            target: "blanker";
            sequence {
               action: SIGNAL_EMIT "e,state,screensaver,active" "e";
            }
         }
         program { signal: "e,state,screensaver,on"; source: "e";
            action: STATE_SET "visible" 0.0;
            transition: DECELERATE 3.0 USE_DURATION_FACTOR 1 CURRENT;
            target: "shadow";
         }
         program { signal: "e,state,screensaver,off"; source: "e";
            action: STATE_SET "default" 0.0;
            transition: ACCELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "blanker";
         }
         program { signal: "e,state,screensaver,off"; source: "e";
            action: STATE_SET "default" 0.0;
            transition: ACCELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "shadow";
         }
         program { signal: "e,state,sys,suspend"; source: "e";
            action: STATE_SET "visible" 0.0;
            transition: ACCELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "suspender";
            sequence {
               action: SIGNAL_EMIT "e,state,sys,suspend,done" "e";
            }
         }
         program { signal: "e,state,sys,hibernate"; source: "e";
            action: STATE_SET "visible" 0.0;
            transition: ACCELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "suspender";
            sequence {
               action: SIGNAL_EMIT "e,state,sys,hibernate,done" "e";
            }
         }
         program { signal: "e,state,sys,resume"; source: "e";
            action: STATE_SET "default" 0.0;
            transition: DECELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "suspender";
         }
         program { signal: "e,state,sys,reboot"; source: "e";
            action: STATE_SET "visible" 0.0;
            transition: ACCELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "suspender";
            sequence {
                action: SIGNAL_EMIT "e,state,sys,reboot,done" "e";
            }
         }
         program { signal: "e,state,sys,halt"; source: "e";
            action: STATE_SET "visible" 0.0;
            transition: ACCELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "suspender";
            sequence {
                action: SIGNAL_EMIT "e,state,sys,halt,done" "e";
            }
         }
         program { signal: "e,state,sys,logout"; source: "e";
            action: STATE_SET "visible" 0.0;
            transition: ACCELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "suspender";
            sequence {
                action: SIGNAL_EMIT "e,state,sys,logout,done" "e";
            }
         }
         program { signal: "e,state,sys,restart"; source: "e";
            action: STATE_SET "visible" 0.0;
            transition: ACCELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "suspender";
            sequence {
                action: SIGNAL_EMIT "e,state,sys,restart,done" "e";
            }
         }
         program { signal: "e,state,sys,restarted"; source: "e";
            action: STATE_SET "visible" 0.0;
            target: "suspender";
         }
         program { signal: "e,state,sys,restarted,show"; source: "e";
            action: STATE_SET "default" 0.0;
            transition: ACCELERATE 0.5 USE_DURATION_FACTOR 1 CURRENT;
            target: "suspender";
            sequence {
              action: SIGNAL_EMIT "e,state,sys,restarted,show,done" "e";
            }
         }
   }
}

group { name: "e/comp/frame/default";
   alias: "e/comp/frame/default/fast"; // legacy
   images.image: "win_shad_flat.png" COMP;
   script {
      public message(Msg_Type:type, id, ...) {
         if ((type == MSG_INT) && (id == 0)) {
            /* set state */
            new st;

            st = getarg(2);
            if (st == 1)
              set_state(PART:"gspacer", "custom", 0.0);
            else
              set_state(PART:"gspacer", "default", 0.0);
         } else if ((type == MSG_INT_SET) && (id == 1)) {
            new l, r, t, b;

            l = getarg(2);
            r = getarg(3);
            t = getarg(3);
            b = getarg(3);

            custom_state(PART:"gspacer", "default", 0.0);
            set_state_val(PART:"gspacer", STATE_REL1_OFFSET, l - 10, t - 10);
            set_state_val(PART:"gspacer", STATE_REL2_OFFSET, -r + 10, -b + 10);
         }
      }
   }
   parts {
      part { name: "clipper"; type: RECT;
         description { state: "default" 0.0;
            rel1.relative: -1.0  -1.0;
            rel1.offset: -9999 -9999;
            rel2.relative: 2.0   2.0;
            rel2.offset: 9999  9999;
            color: 255 255 255 0; // no cc
            visible: 0;
         }
         description { state: "visible" 0.0;
            inherit;
            color: 255 255 255 255; // no cc
            visible: 1;
         }
      }
      part { name: "shadow"; type: RECT;
         clip_to: "clipper";
         description { state: "default" 0.0;
            rel.to: "clipper";
         }
         description { state: "hidden" 0.0;
            inherit;
            visible: 0;
         }
      }
      part { name: "focus-shadow"; type: RECT;
         clip_to: "shadow";
         description { state: "default" 0.0;
            rel.to: "clipper";
            color_class: "/shadow/normal/comp/win";
         }
         description { state: "focused" 0.0;
            inherit;
            color_class: "/shadow/selected/comp/win";
         }
      }
      WIN_SHAD("e.swallow.content", "focus-shadow", "win_shad_flat.png", 21, 21, 14, 28, 0.5)
      part { name: "shower"; type: SPACER;
         description { state: "default" 0.0;
            rel1.relative: 0.05 0.05;
            rel2.relative: 0.95 0.95;
         }
         description { state: "visible" 0.0;
            inherit;
            rel1.relative: 0.0  0.0;
            rel2.relative: 1.0  1.0;
         }
      }
      part { name: "focus-clipper";
         type: RECT;
         clip_to: "clipper";
         mouse_events: 0;
         description { state: "default" 0.0;
            rel.to: "clipper";
            color_class: "/bg/normal/comp/win";
         }
         description { state: "focused" 0.0;
            inherit;
            color_class: "/bg/selected/comp/win";
         }
      }
#define FOCUSGLOWSZ 20
      part { name: "focusglow"; type: RECT;
         mouse_events: 0;
         description { state: "default" 0.0;
            rel.to: "e.swallow.content";
         }
         description { state: "active" 0.0;
            inherit: "default" 0.0;
            offscale;
            rel1.offset: (0-FOCUSGLOWSZ) (0-FOCUSGLOWSZ);
            rel2.offset: (FOCUSGLOWSZ-1) (FOCUSGLOWSZ-1);
            color: 255 255 255 0; // no cc
        }
      }
      part { name: "focusglow1"; type: RECT;
         mouse_events: 0;
         description { state: "default" 0.0;
            clip_to: "focusglow";
            offscale;
            rel2.relative: 1.0 0.0;
            rel1.offset: (0-FOCUSGLOWSZ) (0-FOCUSGLOWSZ);
            rel2.offset: (FOCUSGLOWSZ-1) -1;
            color_class: "/bg/selected/comp/focusglow";
         }
      }
      part { name: "focusglow2"; type: RECT;
         mouse_events: 0;
         description { state: "default" 0.0;
            clip_to: "focusglow";
            offscale;
            rel1.relative: 0.0 1.0;
            rel1.offset: (0-FOCUSGLOWSZ) 0;
            rel2.offset: (FOCUSGLOWSZ-1) (FOCUSGLOWSZ-1);
            color_class: "/bg/selected/comp/focusglow";
         }
      }
      part { name: "focusglow3"; type: RECT;
         mouse_events: 0;
         description { state: "default" 0.0;
            clip_to: "focusglow";
            offscale;
            rel2.relative: 0.0 1.0;
            rel1.offset: (0-FOCUSGLOWSZ) 0;
            rel2.offset: -1 -1;
            color_class: "/bg/selected/comp/focusglow";
         }
      }
      part { name: "focusglow4"; type: RECT;
         mouse_events: 0;
         description { state: "default" 0.0;
            clip_to: "focusglow";
            offscale;
            rel1.relative: 1.0 0.0;
            rel1.offset: 0 0;
            rel2.offset: (FOCUSGLOWSZ-1) -1;
            color_class: "/bg/selected/comp/focusglow";
         }
      }
#undef FOCUSGLOWSZ
      part { name: "e.swallow.content"; type: SWALLOW;
         clip_to: "focus-clipper";
         description { state: "default" 0.0;
            rel.to: "shower";
          }
      }
      spacer { "gspacer";
         desc {
            rel.to: "e.swallow.content";
            rel1.offset: -5 -5;
            rel2.offset:  4  4;
         }
      }
   }
   programs {
       program { signal: "e,state,shadow,on"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "shadow";
      }
      program { signal: "e,state,shadow,off"; source: "e";
         action: STATE_SET "hidden" 0.0;
         target: "shadow";
      }
      program { name: "visible_on";
         signal: "e,state,visible"; source: "e";
         action: STATE_SET "visible" 0.0;
         transition: DECELERATE 0.15 USE_DURATION_FACTOR 1;
         targets: "clipper" "shower";
         sequence {
             action: SIGNAL_EMIT "e,action,show,done" "e";
         }
      }
      program { signal: "e,state,visible"; source: "e";
         action: ACTION_STOP;
         target: "visible_off";
      }
      program { signal: "e,state,hidden"; source: "e";
         action: ACTION_STOP;
         target: "visible_on";
      }
      program { name: "visible_off";
         signal: "e,state,hidden"; source: "e";
         action: STATE_SET "default" 0.0;
         transition: DECELERATE 0.30 USE_DURATION_FACTOR 1;
         targets: "clipper" "shower";
         sequence {
             action: SIGNAL_EMIT "e,action,hide,done" "e";
         }
      }
      program { signal: "e,state,focused"; source: "e";
         action: STATE_SET "focused" 0.0;
         transition: SINUSOIDAL 0.1 USE_DURATION_FACTOR 1;
         targets: "focus-clipper" "focus-shadow";
      }
      program { signal: "e,state,unfocused"; source: "e";
         action: STATE_SET "default" 0.0;
         transition: SINUSOIDAL 0.2 USE_DURATION_FACTOR 1;
         targets: "focus-clipper" "focus-shadow";
      }
      program { name: "focusbounce";
         signal: "e,state,focused"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "focusglow";
         sequence {
            action: STATE_SET "active" 0.0;
            target: "focusglow";
            transition: DECELERATE 0.3 USE_DURATION_FACTOR 1;
         }
      }
      program { name: "focusbounceoff";
         signal: "e,state,unfocused"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "focusglow";
      }
/*
      program { name: "urgent1";
         signal: "e,state,urgent"; source: "e";
         action: STATE_SET "focused" 0.0;
         transition: SINUSOIDAL 0.3 USE_DURATION_FACTOR 1;
         target: "glow";
         sequence {
             action: STATE_SET "default" 0.0;
             transition: SINUSOIDAL 0.3 USE_DURATION_FACTOR 1;
             target: "glow";
             after: "urgent1";
         }
      }
      program {
         signal: "e,state,not_urgent"; source: "e";
         action: STATE_SET "default" 0.0;
         transition: SINUSOIDAL 0.6 CURRENT USE_DURATION_FACTOR 1;
         target: "glow";
      }
      program { signal: "e,state,focus,disabled"; source: "e";
         action: STATE_SET "hid";
         target: "focus_clip";
      }
      program { signal: "e,state,focus,enabled"; source: "e";
         action: STATE_SET "default";
         target: "focus_clip";
      }
 */
   }
}

group { name: "e/comp/frame/rotate";
   alias: "e/comp/frame/rotate/fast"; // legacy
   inherit: "e/comp/frame/default";
   parts {
      part { name: "focusglow"; type: RECT;
         description { state: "default" 0.0;
            visible: 0;
         }
         description { state: "active" 0.0;
            inherit: "default" 0.0;
            visible: 0;
        }
      }
      part { name: "e.swallow.content";
         description { state: "default";
            map {
               on: 1;
               rotation {
                  z: 0;
               }
            }
         }
         description { state: "focus-out";
            inherit: "default";
            map.rotation.z: 180;
         }
      }
      part {
         name: "shower";
         description { state: "default";
            rel1.relative: 0.0  0.0;
            rel2.relative: 1.0  1.0;
         }
      }
   }
   programs {
      program { signal: "e,state,focused"; source: "e";
         action: STATE_SET "default" 0.0;
         target: "e.swallow.content";
         transition: LINEAR 0.3 USE_DURATION_FACTOR 1;
      }
      program { signal: "e,state,unfocused"; source: "e";
         action: STATE_SET "focus-out" 0.0;
         target: "e.swallow.content";
         transition: LINEAR 0.3 USE_DURATION_FACTOR 1;
      }
      program { name: "focusbounce";
         signal: "xxx";
      }
      program { name: "focusbounceoff";
         signal: "xxx";
      }
   }
}

group { name: "e/comp/frame/flip";
   alias: "e/comp/frame/flip/fast"; // legacy
   inherit: "e/comp/frame/rotate";
   parts {
      part { name: "e.swallow.content";
         description { state: "default";
            map {
               on: 1;
               rotation {
                  z: 0;
                  y: 0;
               }
               backface_cull: 1;
            }
         }
         description { state: "focus-out";
            inherit: "default";
            map.rotation {
               z: 0;
               y: 180;
            }
         }
      }
   }
}

group { name: "e/comp/frame/popup";
   alias: "e/comp/frame/popup/fast"; // legacy
   inherit: "e/comp/frame/default";
   parts {
      part { name: "focusglow"; type: RECT;
         description { state: "default" 0.0;
            visible: 0;
         }
         description { state: "active" 0.0;
            inherit: "default" 0.0;
            visible: 0;
        }
      }
      part { name: "focus-clipper";
         description { state: "default";
         }
      }
   }
   programs {
      program { name: "focusbounce";
         signal: "xxx";
      }
      program { name: "focusbounceoff";
         signal: "xxx";
      }
   }
}

group { name: "e/comp/frame/none";
   parts {
      part { name: "e.swallow.content"; type: SWALLOW;
         description { state: "default" 0.0;
         }
      }
   }
   programs {
      program { signal: "e,state,visible"; source: "e";
         action: SIGNAL_EMIT "e,action,show,done" "e";
      }
      program { signal: "e,state,hidden"; source: "e";
         action: SIGNAL_EMIT "e,action,hide,done" "e";
      }
   }
}

group { name: "e/comp/frame/still";
   alias: "e/comp/frame/still/fast"; // legacy
   inherit: "e/comp/frame/default";
   parts {
      part { name: "focusglow"; type: RECT;
         description { state: "default" 0.0;
            visible: 0;
         }
         description { state: "active" 0.0;
            inherit: "default" 0.0;
            visible: 0;
        }
      }
      part { name: "shower";
         description { state: "default" 0.0;
            rel1.relative: 0.0 0.0;
            rel2.relative: 1.0 1.0;
         }
      }
   }
   programs {
      program { name: "focusbounce";
         signal: "xxx";
      }
      program { name: "focusbounceoff";
         signal: "xxx";
      }
   }
}

group { name: "e/comp/frame/menu";
   alias: "e/comp/frame/menu/fast"; // legacy
   inherit: "e/comp/frame/popup";
   images.image: "win_shad_angle.png" COMP;
   parts {
      part { name: "focus-shadow"; type: RECT;
         description { state: "default" 0.0;
            color_class: "/shadow/selected/comp/win";
         }
      }
      WIN_SHAD("e.swallow.content", "focus-shadow", "win_shad_angle.png", 21, 21, 14, 28, 0.5)
      part { name: "shower";
         description { state: "default" 0.0;
            rel1.relative: 0.05 0.0;
            rel2.relative: 0.95 0.9;
         }
      }
   }
}

group { name: "e/comp/frame/everything";
   alias: "e/comp/frame/everything/fast"; // legacy
   inherit: "e/comp/frame/popup";
   parts {
      part { name: "focusglow"; type: RECT;
         description { state: "default" 0.0;
            visible: 0;
         }
         description { state: "active" 0.0;
            inherit: "default" 0.0;
            visible: 0;
        }
      }
      part { name: "shadow";
         description { state: "hidden" 0.0;
            visible: 1;
         }
      }
      part { name: "shower";
         description { state: "default" 0.0;
            rel1.relative: -0.3 -0.3;
            rel2.relative: 1.3 1.3;
         }
      }
   }
   programs {
      program { name: "focusbounce";
         signal: "xxx";
      }
      program { name: "focusbounceoff";
         signal: "xxx";
      }
   }
}

group { name: "e/comp/frame/fullscreen";
   alias: "e/comp/frame/fullscreen/fast"; // legacy
   images.image: "screen_circular_shadow.png" COMP;
   data.item: "screen.bg" "fullscreen.bg";
   parts {
      part { name: "clipper"; type: RECT;
         description { state: "default" 0.0;
            rel1.relative: -1.0  -1.0;
            rel1.offset: -9999 -9999;
            rel2.relative: 2.0   2.0;
            rel2.offset: 9999  9999;
            color: 255 255 255 0; // no cc
            visible: 0;
         }
         description { state: "visible1" 0.0;
            inherit;
            color: 255 255 255 255; // no cc
            visible: 1;
         }
         description { state: "visible2" 0.0;
            inherit;
            color: 255 255 255 255; // no cc
            visible: 1;
         }
      }
      part { name: "clipper_all"; type: RECT;
         description { state: "default" 0.0;
         }
      }
      part { name: "scr_shadow"; mouse_events: 0;
         clip_to: "clipper_all";
         description { state: "default" 0.0;
            rel1.relative: -1.0 -1.0;
            rel2.relative: 2.0 2.0;
            image.normal: "screen_circular_shadow.png";
            fill.smooth: 0;
            color: 0 0 0 0; // no cc
            visible: 0;
         }
         description { state: "visible" 0.0;
            inherit;
            rel1.relative: 0.0 0.0;
            rel2.relative: 1.0 1.0;
            color: 0 0 0 255; // no cc
            visible: 1;
         }
      }
      part { name: "scr_shade"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            visible: 0;
         }
         description { state: "visible" 0.0;
            inherit;
            color: 0 0 0 255; // no cc
            visible: 1;
         }
      }
      part { name: "shower"; type: SPACER;
         description { state: "default" 0.0;
            rel1.relative: 0.5 0.5;
            rel2.relative: 0.5 0.5;
         }
         description { state: "visible1" 0.0;
            inherit;
            rel1.relative: 0.1 0.49;
            rel1.offset: 0 0;
            rel2.relative: 0.9 0.51;
            rel2.offset: -1 -1;
         }
         description { state: "visible2" 0.0;
            inherit;
            rel1.relative: 0.0  0.0;
            rel2.relative: 1.0  1.0;
         }
      }
      part { name: "e.swallow.content"; type: SWALLOW;
         clip_to: "clipper";
         description { state: "default" 0.0;
            rel.to: "shower";
         }
      }
      part { name: "fader"; type: RECT; mouse_events: 0;
         description { state: "default" 0.0;
            rel.to: "e.swallow.content";
            color: 255 255 255 0; // no cc
            visible: 0;
         }
         description { state: "visible1" 0.0;
            inherit;
            color: 255 255 255 255; // no cc
            visible: 1;
         }
         description { state: "visible2" 0.0;
            inherit;
            color: 255 255 255 0; // no cc
            visible: 0;
         }
      }
   }
   programs {
      program { name: "visible_on";
         signal: "e,state,visible"; source: "e";
         action: STATE_SET "visible" 0.0;
         transition: DECELERATE 0.25 USE_DURATION_FACTOR 1;
         targets: "scr_shadow" "scr_shade";
      }
      program { name: "visible_on2";
         signal: "e,state,visible"; source: "e";
         action: STATE_SET "visible1" 0.0;
         transition: DECELERATE 0.05 USE_DURATION_FACTOR 1;
         targets: "clipper" "shower" "fader";
         sequence {
             action: STATE_SET "visible2" 0.0;
             transition: DECELERATE 0.20 USE_DURATION_FACTOR 1;
             targets: "clipper" "shower" "fader";
             action: SIGNAL_EMIT "e,action,show,done" "e";
         }
      }
      program { signal: "e,state,visible"; source: "e";
         action: ACTION_STOP;
         targets: "visible_off" "visible_off2";
      }
      program { signal: "e,state,hidden"; source: "e";
         action: ACTION_STOP;
         targets: "visible_on" "visible_on2";
      }
      program { name: "visible_off";
         signal: "e,state,hidden"; source: "e";
         action: STATE_SET "default" 0.0;
         transition: DECELERATE 0.25 USE_DURATION_FACTOR 1;
         targets: "scr_shadow" "scr_shade";
      }
      program { name: "visible_off2";
         signal: "e,state,hidden"; source: "e";
         action: STATE_SET "visible1" 0.0;
         transition: DECELERATE 0.2 USE_DURATION_FACTOR 1;
         targets: "clipper" "shower" "fader";
         sequence {
             action: STATE_SET "default" 0.0;
             transition: DECELERATE 0.05 USE_DURATION_FACTOR 1;
             targets: "clipper" "shower" "fader";
             action: SIGNAL_EMIT "e,action,hide,done" "e";
         }
      }
   }
}
